﻿<Space>
    <SpaceItem>
        <Button Type="primary" OnClick="@(()=>{ _visible1 = true; })">
            DragInViewport
        </Button>
    </SpaceItem>

    <SpaceItem>
        <Button Type="primary" OnClick="@(()=>{ _visible2 = true; })">
            DragAcrossViewport
        </Button>
    </SpaceItem>
</Space>

<Modal Title="@("DraggableModal")"
       Visible="@_visible1"
       OnOk="(e)=>{_visible1 = false;}"
       Draggable="@(true)"
       OnCancel="(e)=>{_visible1 = false;}">
    <p>Some contents...</p>
    <p>Some contents...</p>
    <p>Some contents...</p>
</Modal>

<Modal Title="@("DraggableModal")"
       Visible="@_visible2"
       OnOk="(e)=>{_visible2 = false;}"
       Draggable="@(true)"
       DragInViewport="@(false)"
       OnCancel="(e)=>{_visible2 = false;}">
    <p>Some contents...</p>
    <p>Some contents...</p>
    <p>Some contents...</p>
</Modal>

@code{
    string title = "DraggableModal";
    bool _visible1 = false;
    bool _visible2 = false;
}